<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Used for establishing secure connections using SSL</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.sqlstate.html">mysqli::$sqlstate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.stat.html">mysqli::stat</a></div>
 <div class="up"><a href="class.mysqli.html">MySQLi</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqli.ssl-set" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli::ssl_set</h1>
  <h1 class="refname">mysqli_ssl_set</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">mysqli::ssl_set</span> -- <span class="refname">mysqli_ssl_set</span> &mdash; <span class="dc-title">Used for establishing secure connections using SSL</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli.ssl-set-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>mysqli::ssl_set</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$cert</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$ca</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$capath</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$cipher</code></span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>mysqli_ssl_set</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.mysqli.html" class="type mysqli">mysqli</a></span> <code class="parameter">$link</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$cert</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$ca</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$capath</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$cipher</code></span>
   )</div>

  <p class="para rdfs-comment">
   Used for establishing secure connections using SSL. It must be called
   before <span class="function"><a href="mysqli.real-connect.html" class="function">mysqli_real_connect()</a></span>. This function does
   nothing unless OpenSSL support is enabled.
  </p>

  <p class="para">
    Note that MySQL Native Driver does not support SSL before PHP 5.3.3, 
    so calling this function when using MySQL Native Driver will result 
    in an error. MySQL Native Driver is enabled by default on Microsoft 
    Windows from PHP version 5.3 onwards.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli.ssl-set-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
link</code></em></dt>
<dd>
<p class="para">仅以过程化样式：由<span class="function"><a href="function.mysqli-connect.html" class="function">mysqli_connect()</a></span> 或 <span class="function"><a href="mysqli.init.html" class="function">mysqli_init()</a></span>
返回的链接标识。</p></dd>

    
     <dt>
<em><code class="parameter">key</code></em></dt>

     <dd>

      <p class="para">
       The path name to the key file.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">cert</code></em></dt>

     <dd>

      <p class="para">
       The path name to the certificate file.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">ca</code></em></dt>

     <dd>

      <p class="para">
       The path name to the certificate authority file.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">capath</code></em></dt>

     <dd>

      <p class="para">
       The pathname to a directory that contains trusted SSL CA certificates
       in PEM format.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">cipher</code></em></dt>

     <dd>

      <p class="para">
       A list of allowable ciphers to use for SSL encryption.
      </p>
     </dd>

    
   </dl>

  </p>
  <p class="para">
   Any unused SSL parameters may be given as <strong><code>NULL</code></strong>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysqli.ssl-set-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   This function always returns <strong><code>TRUE</code></strong> value. If SSL setup is
   incorrect <span class="function"><a href="mysqli.real-connect.html" class="function">mysqli_real_connect()</a></span> will return an error
   when you attempt to connect.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mysqli.ssl-set-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="mysqli.options.html" class="function" rel="rdfs-seeAlso">mysqli_options()</a> - Set options</span></li>
    <li class="member"><span class="function"><a href="mysqli.real-connect.html" class="function" rel="rdfs-seeAlso">mysqli_real_connect()</a> - Opens a connection to a mysql server</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.sqlstate.html">mysqli::$sqlstate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.stat.html">mysqli::stat</a></div>
 <div class="up"><a href="class.mysqli.html">MySQLi</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
